from package.fastapi.schema import Page, BatchId
from pydantic import Field, BaseModel
from typing import List


class _Enum(BaseModel):
    key: str = Field(..., title='')
    value: str = Field(..., title='')
    description: str = Field('', title='描述')


class EditEnum(BaseModel):
    description: str = Field(..., title='描述')
    option: List[_Enum] = Field(..., title='选项')


class Enum(EditEnum):
    name: str = Field(..., title='枚举名')


class EnumOut(Enum):

    class Config:
        orm_mode = True


class PageEnumOut(Page):
    data: List[EnumOut] = Field(..., title='enum列表')


class BatchName(BaseModel):
    names: List[str] = Field(..., title='批量删除')
